package com.mxpio.erp.common.equipment.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.jpa.policy.impl.UUIDPolicy;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import com.mxpioframework.security.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;


/**
 * 保养任务转单历史对象 MB_ERP_EQUIPMENT_UPKEEP_TASK_TRANSFER
 * 
 * @author Cheng
 * @date 2023-07-28
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_EQUIPMENT_UPKEEP_TASK_TRANSFER")
@Schema(description="保养任务转单历史")
public class EquipmentUpkeepTaskTransfer extends BaseEntity {

private static final long serialVersionUID=1L;

    @Id
    @Generator(policy = UUIDPolicy.class)
    @Column(name = "ID_")
    @Schema(description = "主键")
    private String id;

    @Column(name = "BIZ_NO_")
    @Schema(description = "保养工单编码")
    private String bizNo;

    @Column(name = "TYPE_")
    @Schema(description = "转单类型")
    @Dict(dicCode = "ERP_EQUIPMENT_TASK_TRANSFER_TYPE")
    private String type;

    @Column(name = "OLD_EXECUTOR_")
    @Schema(description = "原执行者")
    @Dict(dicCode = "username", dicEntity = User.class, dicText = "nickname")
    private String oldExecutor;

    @Column(name = "NEW_EXECUTOR_")
    @Schema(description = "现执行者")
    @Dict(dicCode = "username", dicEntity = User.class, dicText = "nickname")
    private String newExecutor;

    @Column(name = "REASON_")
    @Schema(description = "变更原因")
    private String reason;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Column(name = "TRANSFER_TIME_")
    @Schema(description = "转单时间")
    private java.util.Date transferTime;

}
